package com.An.service.impl;

import com.An.dao.StudentDao;
import com.An.pojo.*;
import com.An.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @auther AnYang
 * @date 2022/4/14 19:43
 **/
@Service
public class StudentServiceImpl implements StudentService {
	@Autowired
	private StudentDao dao;

	@Override
	public List<StudentCourse> getStudentCourseBySno(Integer sno) {
		return dao.getStudentCourseBySno(sno);
	}

	@Override
	public boolean updateUserInfo(StudentUser user) {
		return dao.updateUserInfo(user) > 0;
	}

	@Override
	public boolean addApplication(Apply apply) {
		return dao.addApplication(apply) > 0;
	}

	@Override
	public boolean deleteApplication(Integer sno, Integer sign) {
		return dao.deleteApplication(sno, sign) > 0;
	}

	@Override
	public StudentUser getUserInfoByUserId(String userId) {
		return dao.getUserInfoByUserId(userId);
	}

	@Override
	public StudentUser getUserInfoBySno(Integer sno) {
		return dao.getUserInfoBySno(sno);
	}

	@Override
	public List<ClassTeacher> getTeacherByClass(String sclass) {
		return dao.getTeacherByClass(sclass);
	}

	@Override
	public List<StuCourseInfo> getCourseByClass(String sclass) {
		return dao.getCourseByClass(sclass);
	}

	@Override
	public List<Dormitory> getDormList() {
		return dao.getDormList();
	}

	@Override
	public List<StudentApplication> getUpdateStuDormApplication() {
		return dao.getUpdateStuDormApplication();
	}

	@Override
	public Course getCourseByName(String cname) {
		return dao.getCourseByName(cname);
	}

	@Override
	public StudentDorm getStudentDormBySno(Integer sno) {
		return dao.getStudentDormBySno(sno);
	}

	@Override
	public boolean addStudentDorm(StudentDorm student) {
		return dao.addStudentDorm(student) > 0;
	}

	@Override
	public boolean addStuDormApplication(StudentApplication studentApplication) {
		return dao.addStuDormApplication(studentApplication) > 0;
	}

	@Override
	public boolean deleteStudentDormIsNull(Integer sno) {
		return dao.deleteStudentDormIsNull(sno) > 0;
	}

	@Override
	public boolean updateStudentDormSign(Integer sign, Integer sno) {
		return dao.updateStudentDormSign(sign, sno) > 0;
	}
}